<template>
	<view class="container">
		<scroll-view 
			class="scroll-view_H" 
			scroll-x="true" 
			:scroll-with-animation="true"
			:scroll-left="scrollLeft"
		>
			<view 
				:class="index === page 
						? 'active scroll-view-item_H' 
						: 'scroll-view-item_H' " 
				v-for="(item,index) in navList" 
				:key="index"
				@click="handleSelectClick(index)"
			>
				{{item}}	
			</view>
			
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name:"nav-list",
		props: {
			page: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				scrollLeft: 0,
				navList: [
					"员工入职信息登记表",
					"家庭主要成员",
					"简历",
					// "劳动合同",
					// "劳动合同(临时工)",
					// "劳务合同(退休人员)",	
				],
			};
		},
		methods: {
			handleSelectClick (index) {
				this.$emit("changeSelect",index)
			}
		}
	}
</script>

<style lang="scss">
	
.container{
	width: 100%;
	position: fixed;
	left: 0;
	top: 0;
	height: 80rpx;
	z-index: 99;
	
	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
		.scroll-view-item_H {
			display: inline-block;
			width: 340rpx;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			font-size: 30rpx;
			color: #FFFFFF;
			background: #7E7E7E;
			margin-right: 1px;
		}
		.active {
			background: #2D83FE;
		}
	}
}
</style>